<div class="detailsBox">
      <h3 class="mt20"><i class="jtIco"></i> 总部归档</h3>
       <form id="archiveRecordForm" action="/archive/rest/saveArchiveRecord" class="action-ajax-form" method="post">
       <div class="cktitle" style="margin-top:10px;"><span class="xiala"></span>归档材料清单</div>
       <div class="m10 detaiTab" style="border-right:1px solid #e1e1e1; border-left:1px solid #e1e1e1">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="b_t_e5">
                    <tbody>
                    	<#list 0..(archiveFields?size/3)?ceiling-1 as x> 
                    	 	<tr>
                    	 		<#list 0..2 as index> 
	                    	 		<#if archiveFields[x*3+index]??>
			                            <td align="right" class="bg " width="15%"><span><font color="red">*</font></span>${archiveFields[x*3+index].fieldName}</td>
			                            <td class="fieldVaule" data="${archiveFields[x*3+index].fieldName}">
			                            	<#if archiveFields[x*3+index].fieldValue?? && archiveFields[x*3+index].fieldValue?index_of('_')!=-1>
		                            			<input disabled="disabled" style="width:40px" name="checkValue" type="text" value="${archiveFields[x*3+index].fieldValue?split('_')[0]}"/>
		                            		<#elseif archiveFields[x*3+index].fieldValue??>
		                            			<input disabled="disabled" style="width:40px" name="checkValue" type="text" value="${archiveFields[x*3+index].fieldValue}"/>
		                            		<#else>
		                            			<input disabled="disabled" style="width:40px" name="checkValue" type="text"/>
		                            		</#if>
			                            <select>
			                            	<option>请选择</option>
			                            	<#list archiveFields[x*3+index].fieldMin..archiveFields[x*3+index].fieldMax as i> 
			                            		<#if archiveFields[x*3+index].fieldValue?? 
				                            		&& archiveFields[x*3+index].fieldValue?index_of('_') != -1 && archiveFields[x*3+index].fieldValue?split('_')[1] ==i >
			                            				<option selected="selected">${i}</option>
			                            		<#elseif archiveFields[x*3+index].fieldValue??  
			                            		 	&& archiveFields[x*3+index].fieldValue?index_of('_') == -1 && archiveFields[x*3+index].fieldValue == i > 
			                            			<option selected="selected">${i}</option>		
			                            		<#else>
			                            			<option>${i}</option>
			                            		</#if>
			                            	</#list>
			                            </select>
			                                                       份</td>
	                    	 		<#else>
	                    	 			<td align="right" class="bg" width="15%"></td>
			                            <td></td>
	                    	 		</#if>
                    	 		</#list>
	                        </tr>
						</#list>
                    </tbody>
                </table> 
            </div>
            <input name="loanapplyNo" type="hidden" value="${loanapplyNo}"/>
            <input name="bankTypeId" type="hidden" value="${bankTypeId}"/>
            <input name="formTypeId" type="hidden" value="${formTypeId}"/>
            <input id="contentJsonInpu" name="contentJson" type="hidden""/>
            </form>
    </div>
  <div class=" mtb20 tac">
  	<span id="archiveErrorMsg" style="disploy:none;" class="red"></span></br>
  	<a id="saveArchiveRecordBtn" href="#" class="btn_auto_30 btn_blue">保 存</a>
  </div>
<@js>
	$("#saveArchiveRecordBtn").click(function(){
		var checkSelect=1;
		var errorMsg="";
		var contentJson={};
		$('#archiveRecordForm table').find('.fieldVaule').each(function(f,field){
			var key=$(field).attr('data');
			var checkValue=$(field).find('input[name="checkValue"]').val();
			var selectValue=$(field).find('select').val();
			contentJson[key]=checkValue+'_'+selectValue;
			if(selectValue=="请选择"){
				checkSelect=0;
				errorMsg=key+"不能为空!";
				return false;
			}
		});
		if(!checkSelect){
			$('#archiveErrorMsg').text(errorMsg).show();
			return;
		}
		$('#archiveErrorMsg').text('').hide();
		$('#contentJsonInpu').val(JSON.stringify(contentJson));
		$('#archiveRecordForm').submit();
   });
</@js>
<@jsRender/>